home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 21.zip / BS1 part 21 / Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].7z / Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].adf / rexx.lzh / DropShadowBox.pprx < prev    next >
Text File  |  1992-03-13  |  2KB  |  96 lines

  1. /*
  2. @BDropShadowBox  @P@ICopyright Gold Disk Inc., February, 1992
  3.  
  4. This Genie creates a drop shadow box for a selected box.
  5. */
  6. cr = '0a'x
  7. arg box
  8.  
  9. address command
  10. call SafeEndEdit.rexx()
  11. call ppm_AutoUpdate(0)
  12.  
  13. units = ppm_GetUnits()
  14. if units = 3 then
  15.     call ppm_SetUnits(1)
  16.  
  17. signal on halt
  18. signal on break_c
  19. signal on break_e
  20. signal on break_d
  21.  
  22.  
  23. if box  = '' then
  24. do
  25.         box = ppm_ClickOnBox("Select box for Drop Shadow")
  26.         if box  = 0 then exit_msg()
  27. end
  28.  
  29. boxsize     = ppm_GetBoxSize(box)
  30. boxwidth    = word(boxsize, 1)
  31. boxheight   = word(boxsize, 2)
  32.  
  33. if units = 3 then
  34. do
  35.    x = ppm_ConvertUnits(1, 3, boxwidth * .1)
  36.    y = ppm_ConvertUnits(1, 3, boxheight * .1)
  37. end
  38. else
  39. do
  40.     x = boxwidth * .1
  41.     y = boxheight * .1
  42. end
  43.  
  44. offset = "X:" || x || cr || "Y:" || y
  45.  
  46. offset = ppm_GetForm("Select Drop Shadow offset..", 8, offset)
  47. if offset = '' then exit_msg()
  48.  
  49. parse var offset xoffset '0a'x yoffset
  50. if ~(datatype(xoffset, n) & datatype(yoffset, n)) then exit_msg("Invalid Entry")
  51.  
  52. if units = 3 then
  53. do
  54.    xoffset = ppm_ConvertUnits(3, 1, xoffset)
  55.    yoffset = ppm_ConvertUnits(3, 1, yoffset)
  56. end
  57.  
  58. newbox = ppm_CloneBox(box, xoffset, yoffset)
  59.  
  60. if upper(word(ppm_GetBoxInfo(newbox), 1)) ~= 'EMPTY' then
  61.         call ppm_DeleteContents(newbox)
  62.  
  63. colorlist   = ppm_GetColorList()
  64. colorlist   = delstr(colorlist, 1, pos('0a'x, colorlist))
  65. color       = ppm_SelectFromList("Select Fill Color", 30, 5, 0, colorlist)
  66. if color = '' then exit_msg()
  67.  
  68. call ppm_SetBoxTransparent(newbox,0)
  69. call ppm_SetBoxTransparent(box,0)
  70. call ppm_BoxToBack(newbox)
  71. call ppm_SetBoxFrame(box, 1)
  72. call ppm_SetBoxFrame(newbox, 1)
  73. call ppm_SetBoxFrameData(newbox, color, color, ppm_GetLineWeight(), ppm_GetLinePattern(), 1)
  74.  
  75. if ppm_GetWireFrame() then call ppm_ShowStatus("Select Wire Frame mode to see results")
  76.  
  77. exit_msg()
  78. break_d:
  79. break_e:
  80. break_c:
  81. halt:
  82.     call exit_msg("User aborted Genie!")
  83.  
  84. exit_msg: procedure expose units
  85. do
  86.         parse arg message
  87.  
  88.         if message ~= '' then
  89.             call ppm_Infrom(1, message,)
  90.  
  91.         call ppm_SetUnits(units)
  92.  
  93.         call ppm_AutoUpdate(1)
  94.         exit
  95. end